<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="keywords" content="" />
		<meta http-equiv="description" content="" />
		<title>見積管理</title>

		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>

		<script src="assets/scripts/ui/jquery-ui-1.7.2.custom.js" type="text/javascript"></script>
		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript">
		$(function() {
		
			// メッセージのフェード
			$('.message').fadeIn("slow");

		});
		</script>
		
		<!--タイムコントロール -->
		<script>
		$(document).ready(function(){  
			$("#r_date1").wrDate();  
			$("#r_date2").wrDate();  
			$("#u_date1").wrDate();  
			$("#u_date2").wrDate();  
			$("#e_date1").wrDate();  
			$("#e_date2").wrDate();
		});

		$.extend({ 
			wrDate : function(objs) { 
			objs.each(function(i) { 
				//jQueryオブジェクトをトラバース
				var inputObj = $(this); 
				inputObj.datepicker({
					changeMonth: true,
					changeYear: true,
					dateFormat: 'yy/mm/dd'
				}); //各jQueryオブジェクトにCalendarコントロール
			}); 
		}});

		$.fn.extend({ 
			wrDate : function() { 
			//wrDate jQueryプラグインの名前を定義します
			$.wrDate(this); //呼び出す前に、カスタムjQuery関数 
		}});
		
		</script>	
		
		
		
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />

		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
		<script type="text/javascript">
			var sorter = new TINY.table.sorter("sorter");
				sorter.head = "head";
				sorter.asc = "asc";
				sorter.desc = "desc";
				sorter.even = "evenrow";
				sorter.odd = "oddrow";
				sorter.evensel = "evenselected";
				sorter.oddsel = "oddselected";
				sorter.paginate = true;
				sorter.currentid = "currentpage";
				sorter.limitid = "pagelimit";
			$(function(){
					sorter.init("inquiry_result",0);
			});
		</script>
		
		
	</head>
	<body id="" >
{{ php }} include( MENU_FILE ); {{ /php }}

		<div id="header" class="clearfix"><div class="wrapper">
			<h1><a href="./">コントロールパネル</a></h1>
			<form id="form_logout" action="logout.php" method="post"><p>{{ $login.staff_name }} <input type="submit" id="button_logout" value="ログアウト" /></p></form>
		</div></div>
		<div id="container"><div class="wrapper">

			<h2>見積管理</h2>
			<ul class="submenu clearfix">
				<li><a href="consumer_index.php">顧客検索</a></li>								
				<li><a href="consumer_form.php">顧客登録</a></li>
				<li><a href="price_task.php">見積タスク一覧</a></li>
				<li><a href="price_check.php">見積検索</a></li>
				<li><a href="shop_index.php">商品マスタ</a></li>
			</ul>
			
			<h3>顧客別単価リスト</h3>
			<!-- 
			<h4>顧客検索一覧</h4>
			<ul>			
				<li>＞ <a href="consumer_price.php">顧客別単価リスト</a></li>
			</ul>
			 -->
			<p class="message">条件を入力し、検索ボタンをクリックしてください。</p>
				
			<div>
				<div >
			
				<span>会社名：{{$consumer.company_name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;セールス担当者：{{$consumer.sal_manager}}</span>
				<hr/>
				<form action="consumer_price.php" method="get">
				<input type="hidden" name="consumer_id" value="{{$consumer_id}}" />
				<table id="inquiry_result" class="formTable">
					<thead>
						<tr>
							<th>フリーワード</th>
							<td><input type="text" name="shop_name" id="text_information" class="text" value="{{$forms.shop_name}}" /></td>
						</tr>
						<tr>
							<th>型番</th>
							<td><input type="text" name="type" id="text_information" class="text" value="{{$forms.type}}" /></td>
						</tr>
						<tr>
							<th>仕様</th>
							<td><input type="text" name="style" id="text_information" class="text" value="{{$forms.style}}" /></td>
						</tr>
						<tr>
							<th>数量</th>
							<td><input type="text" name="num" id="text_information" class="text" value="{{$forms.num}}" /></td>
						</tr>
						<tr>
							<th>件名</th>
							<td>
								<select id="text_information" name="pro_name" class="text">
							<option value="">選択してください</option>
											
							{{ foreach from=$make_price_option key=k item=v }}
								<option value="{{$k}}" {{if $forms.pro_name == $k }} selected {{/if}} >{{$v}}</option>
							{{ /foreach }}
									</select>
							</td>
						</tr>
						<tr>
							<th>単価</th>
							<td><input type="text" name="refer_price1" class="text" style="width: 100px" value="{{$forms.refer_price1}}" />&nbsp;～&nbsp;<input type="text"  class="text" name="refer_price2" style="width: 100px" value="{{$forms.refer_price2}}"  /></td>
						</tr>
						<tr>
							<th>適用期間</th>
							<td>
								<table  >
									<tr>
									<td style="border: 0" colspan="2" ><input type="radio" name="r" value="1" {{ if $forms.r == 1 ||  $forms.r==''}}checked="checked"{{ /if }}   /> すべて</td>
									</tr>
									<tr>
									<td style="border: 0"><input type="radio" name="r" value="2" {{ if $forms.r == 2 }}checked="checked"{{ /if }} /> テキスト</td><td style="border: 0"><input type="text" name="period_remark" id="text_information" class="text" value="{{$forms.period_remark}}" /></td>
									</tr>
									<tr>
									<td style="border: 0"><input type="radio" name="r" value="3" {{ if $forms.r == 3 }}checked="checked"{{ /if }}  /> 期間</td><td style="border: 0">開始日<input type="text" id="r_date1" class="text" name="r_date1" style="width: 100px" value="{{$forms.r_date1}}"  />&nbsp;～&nbsp;<input type="text" class="text" id="r_date2" name="r_date2" style="width: 100px"  value="{{$forms.r_date2}}" /></td>
									</tr>
									<tr>
									<td style="border: 0">&nbsp;</td><td style="border: 0">終了日<input type="text" id="u_date1" class="text" name="u_date1" style="width: 100px"  value="{{$forms.u_date1}}" />&nbsp;～&nbsp;<input type="text" class="text" id="u_date2" name="u_date2" style="width: 100px"  value="{{$forms.r_date2}}" /></td>
									</tr>
								</table>
								
							</td>
						</tr>
						<!-- 
						<tr>
							<th>適用開始日</th>
							<td><input type="text" id="r_date1" class="text" name="r_date1" style="width: 100px" value="{{$forms.r_date1}}"  />&nbsp;～&nbsp;<input type="text" class="text" id="r_date2" name="r_date2" style="width: 100px"  value="{{$forms.r_date2}}" /></td>
						</tr>
						<tr>
							<th>適用終了日</th>
							<td><input type="text" id="u_date1" class="text" name="u_date1" style="width: 100px"  value="{{$forms.u_date1}}" />&nbsp;～&nbsp;<input type="text" class="text" id="u_date2" name="u_date2" style="width: 100px"  value="{{$forms.r_date2}}" /></td>
						</tr>
						 -->
						<tr>
							<th>承認日</th>
							<td><input type="text" id="e_date1" class="text" name="e_date1" style="width: 100px"  value="{{$forms.e_date1}}" />&nbsp;～&nbsp;<input type="text" class="text" id="e_date2" name="e_date2" style="width: 100px"  value="{{$forms.e_date2}}" /></td>
						</tr>
					</thead>			
				</table>
						
				<p class="button">
					<button type="submit" id="btn_search" class="submit" ><span>検索</span></button>
				</p>
				
				
				</form>
			</div>
				<br/>

				<p class="message">検索へ<span style="color: red">{{$cnt}}</span>レコード</p>
			{{if $cnt > 0 }}
				<form name="form1" action="consumer_price_csv.php" method="get">
				<input type="hidden" name="page" value="{{$page.current}}"/>	
				<input type="hidden" name="consumer_id" value="{{$consumer_id}}" />
				<input type="hidden" name="shop_name" value="{{$forms.shop_name}}" />
				<input type="hidden" name="type" value="{{$forms.type}}" />
				<input type="hidden" name="style" value="{{$forms.style}}" />
				<input type="hidden" name="num"  value="{{$forms.num}}" />
				<input type="hidden" name="pro_name"  value="{{$forms.pro_name}}" />
				
				<input type="hidden" name="refer_price1"  value="{{$forms.refer_price1}}" />
				<input type="hidden" name="refer_price2"  value="{{$forms.refer_price2}}"  />
				<input type="hidden" name="r_date1" value="{{$forms.r_date1}}"  />
				<input type="hidden" name="r_date2"  value="{{$forms.r_date2}}" />
				<input type="hidden" name="u_date1"  value="{{$forms.u_date1}}" />
				<input type="hidden" name="u_date2"   value="{{$forms.u_date2}}" />
				<input type="hidden" name="e_date1"  value="{{$forms.e_date1}}" />
				<input type="hidden" name="e_date2"   value="{{$forms.e_date2}}" />
						
				<table id="inquiry_result" class="formTable">
					<thead>
						<tr align="center">
							<th>件名</th>
							<th>型番</th>
							<th>仕様</th>
							<th>数量</th>
							<th>参考価格</th>
							<th>掛率</th>
							<th>単価</th>
							<th>承認日</th>
							<th>適用開始</th>
							<th>適用終了</th>
						</tr>
					</thead>
					<tbody>
						
	{{ foreach from=$list key=k item=v }}
						<tr align="center" {{if $v.dateover==1}} bgcolor="#E7E7E7" {{/if}}>
							<td ><img src="assets/images/titleicon/{{ $v.pro_name }}.gif"  ></img></td>
							<td>{{ $v.type }}</td>
							<td>{{ $v.style }}</td>
							<td>{{ $v.quantity }}</td>
							<td>￥{{ $v.refer_price }}</td>
							<td>{{ $v.discount }}</td>
							<td>￥{{ $v.cmoney }}</td>
							<td>{{ $v.e_date }}</td>
							<td>{{ $v.period_str }}</td>
							<td>{{ $v.period_end }}</td>
						</tr>
	{{ /foreach }}				
					</tbody>
				</table>
	<p align="center">
{{ if $page.current > 1 }}
				<a href="consumer_price.php?page={{ $page.current-1 }}{{ $page.query }}">前の{{ $page.item }}件</a>&nbsp;&nbsp;
{{ /if }}
{{ foreach from=$page.paging key=k item=v }}
{{ if $v < $page.current+15 }}
{{ if $page.current == $v }}
{{ $v }}&nbsp;
{{ else }}
				<a href="consumer_price.php?page={{ $v }}{{ $page.query }}">{{ $v }}</a>&nbsp;
{{ /if }}
{{ /if }}
{{ /foreach }}
{{ if $page.end > $page.current }}
				<a href="consumer_price.php?page={{ $page.current+1 }}{{ $page.query }}">次の{{ $page.item }}件</a>
{{ /if }}
			</p>	
				<p class="button">
					<button type="submit" id="btn_csv" class="submit" ><span>CSV出力</span></button>
				</p>
			</form>
			{{/if}}
		  </div>

		</div></div>
			
			
		<address>Copyright (C) SHIFT Inc. / All rights reserved</address>

	</body>
</html>